
 DoFontMenu
============

Program		DoFontMenu
Purpose		A dynamic menu allowing the desktop font to be set.
Author		Lenny
Version		1.00, Tuesday the 19th Feb 2002
Copyright	(C) Lenny 2002


Requires RISC OS 3.50, or later.

Called in response to a user selection from the desktop font menu
(as generated by 'Menus.System.FontMenu').

If the new boot is not detected (specifically, if
'<Choices$Write>.Boot.PreDesk' doesn't exist) then selection of fonts
/other/ than System Font or one of the first 14 in ResourceFS is
prevented, as in such a case a file would need to be saved in
...PreDesk.

If System Font or one of the first 14 from ResourceFS is chosen, then
the CMOS memory is updated accordingly and if the file
'<Choices$Write>.Boot.PreDesk.FontSetup' exists, it is deleted.

If a disc based font (or one from ResourceFS, numbered higher than 14)
is chosen, then a value of 0 is placed in the CMOS bits) and <Wimp$Font>
is set up, both immediately and (to ensure that this setting survives a
re-boot) in the file '<Choices$Write>.Boot.PreDesk.FontSetup'.

To my knowledge, this mimics the action of !Configure.

---------------------------------------------------------------------------

Technical :
=========

  CMOS byte 140, bits 1-4 determine the destop font :

    0    : Use <Wimp$Font>
    1    : System Font
    2-15 : The first (alphabetically) 14 fonts found in ResourceFS

    By default (ie just those in ROM) :

         RISC OS 3.50-3.70          RISC OS 4.02
         -------------------------- --------------------------
    2  : Corpus.Bold                Corpus.Bold
    3  : Corpus.Bold.Oblique        Corpus.Bold.Oblique
    4  : Corpus.Medium              Corpus.Medium
    5  : Corpus.Medium.Oblique      Corpus.Medium.Oblique
    6  : Homerton.Bold              Homerton.Bold
    7  : Homerton.Bold.Oblique      Homerton.Bold.Oblique
    8  : Homerton.Medium            Homerton.Medium
    9  : Homerton.Medium.Oblique    Homerton.Medium.Oblique
    10 : Trinity.Bold               Sidney
    11 : Trinity.Bold.Italic        Trinity.Bold
    12 : Trinity.Medium             Trinity.Bold.Italic
    13 : Trinity.Medium.Italic      Trinity.Medium
    14 : WIMPSymbol                 Trinity.Medium.Italic
    15 : ---                        WIMPSymbol

    This list can be changed by adding fonts to ResourceFS, using a tool
    such as AddRes (in '!Director.Utils').  As only the first 14 can be
    represented in the 4 CMOS bits, if a ResourceFS font numbered higher
    than this is chosen, it falls back to using a CMOS value of 0 and
    making use of the Wimp$Font variable.

---------------------------------------------------------------------------

Lenny: 24 Feb 2002
